This feature allows printing of notes. It works on both the desktop client, but also on the web.
Note that not all note types are printable as of now. We do plan to increase the coverage of supported note types in the future.
To print a note, select the
button to the right of the note and select Print note. Depending
on the size and type of the note, this can take up to a few seconds. Afterwards
you will be redirected to the system/browser printing dialog.
Should you encounter any visual issues in the resulting PDF file (e.g.
a table does not fit properly, there is cut off text, etc.) feel free to
report the issue. In this case, it's best to offer a sample note (click
on the
button, select Export note → This note and all of its descendants → HTML
in ZIP archive). Make sure not to accidentally leak any personal information.
Consider adjusting font sizes and using page breaks to work around the layout.
On the desktop application of Trilium it is possible to export a note as PDF. On the server or PWA (mobile), the option is not available due to technical constraints and it will be hidden.
To print a note, select the
button to the right of the note and select Export as PDF. Afterwards
you will be prompted to select where to save the PDF file.
When the PDF is exported, it is automatically opened with the system default application for easy preview.
Note that if you are using Linux with the GNOME desktop environment, sometimes the default application might seem incorrect (such as opening in GIMP). This is because it uses Gnome's “Recommended applications” list.
To solve this, you can change the recommended application for PDFs via
this command line. First, list the available applications via gio mime application/pdf and
then set the desired one. For example to use GNOME's Evince:
gio mime application/pdf
When exporting to PDF, there are no customizable settings such as page orientation, size. However, there are a few Attributes to adjust some of the settings:
#printLandscape.#printPageSize attribute,
with one of the following values: A0,
A1, A2, A3,
A4, A5, A6,
Legal, Letter, Tabloid,
Ledger.Since v0.100.0, it is possible to print more than one note at the time by using Collections:
The resulting collection will contain all the children of the collection, while maintaining the hierarchy.
It's possible to trigger both printing and export as PDF from the keyboard by going to Keyboard shortcuts in Options and assigning a key combination for:
Not all Note Types are supported when printing, in which case the Print and Export as PDF options will be disabled.
#printLandscape if
exporting to PDF.printCss relation
needs to be used (see below).As an advanced use case, it's possible to customize the CSS used for printing such as adjusting the fonts, sizes or margins. Note that Custom app-wide CSS will not work for printing.
To do so:
~printCss relation
to point to the newly created CSS code note.For example, to change the font of the document from the one defined by the theme or the user to a serif one:
body {
--main-font-family: serif !important;
--detail-font-family: var(--main-font-family) !important;
}
To remark:
~printCss relations.printCss doesn't
have the right note type or mime type, it will be ignored.@media print { since the style-sheet is used only for printing.Both printing and exporting as PDF use the same mechanism: a note is rendered individually in a separate webpage that is then sent to the browser or the Electron application either for printing or exporting as PDF.
The webpage that renders a single note can actually be accessed in a web
browser. For example http://localhost:8080/#root/WWRGzqHUfRln/RRZsE9Al8AIZ?ntxId=0o4fzk becomes
http://localhost:8080/?print#root/WWRGzqHUfRln/RRZsE9Al8AIZ.
Accessing the print note in a web browser allows for easy debugging to understand why a particular note doesn't render well. The mechanism for rendering is similar to the one used in Note List.